import request from '@/config/axios'

// 工作汇报 VO
export interface WorkReportVO {
  id: number // 主键ID
  reportType: boolean // 汇报类型
  recipient: string // 接收人
  reportPeriod: string // 汇报周期
  reportDate: Date // 汇报日期
  currentWork: string // 本期工作内容
  nextPlan: string // 下期计划
  otherMatters: string // 其它事项
  attachmentUrls: string // 附件URL列表(JSON格式存储)
  reportStatus: number // 汇报状态
  sendTime: Date // 发送时间
}

// 工作汇报 API
export const WorkReportApi = {
  // 查询工作汇报分页
  getWorkReportPage: async (params: any) => {
    return await request.get({ url: `/oa/work-report/page`, params })
  },


  getReportPage: async (params: any) => {
    return await request.get({ url: `/oa/work-report/received-page`, params })
  },

  // 查询工作汇报详情
  getWorkReport: async (id: number) => {
    return await request.get({ url: `/oa/work-report/get?id=` + id })
  },

  // 新增工作汇报
  createWorkReport: async (data: WorkReportVO) => {
    return await request.post({ url: `/oa/work-report/create`, data })
  },

  // 修改工作汇报
  updateWorkReport: async (data: WorkReportVO) => {
    return await request.put({ url: `/oa/work-report/update`, data })
  },

  // 删除工作汇报
  deleteWorkReport: async (id: number) => {
    return await request.delete({ url: `/oa/work-report/delete?id=` + id })
  },

  // 导出工作汇报 Excel
  exportWorkReport: async (params) => {
    return await request.download({ url: `/oa/work-report/export-excel`, params })
  }
}
